<template>
  <div class="helper">
    <slot name="image"></slot>
    <div class="highlight" :style="styleObject">
      <slot name="helperText"></slot>
    </div>
  </div>
</template>

<script>
/**
 * 错误信息友好提示组件
 * created by Daiwinxing on 2020 01/23
 * */

export default {
    props: {
        backgroundColor: {
            type: String,
            required: false
        },
        textColor: {
            type: String,
            required: false
        }
    },
    name: 'base-helper',
    data () {
        return {
            styleObject: {
                'background-color': this.backgroundColor || '#f2dede',
                color: this.textColor || '#d1254e'
            }
        };
    }
};
</script>

<style scoped lang="less">
.helper {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translateX(-50%) translateY(-50%);
  .icon {
    width: 3.5rem;
    height: 3.5rem;
    vertical-align: -0.15em;
    fill: currentColor;
    overflow: hidden;
  }
  .highlight {
    border-radius: 10px;
    font-size: 14px;
    padding: 8px 14px;
    margin: 10px 4px;
    text-align: center;
  }
}
</style>
